<%@ Page Language="C#" MasterPageFile="~/Demo.master" AutoEventWireup="true" 
CodeFile="ContextMenu.aspx.cs" Inherits="ContextMenu" 
Title="Context Menu (Calendar) | DayPilot Pro Demo" %>
<%@ Register Assembly="DayPilot" Namespace="DayPilot.Web.Ui" TagPrefix="DayPilot" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <DayPilot:DayPilotCalendar ID="DayPilotCalendar1" runat="server" 
        DataTextField="name" 
        DataValueField="id" 
        DataStartField="start" 
        DataEndField="end" 
        ContextMenuID="DayPilotMenu1" 
        OnEventMenuClick="DayPilotCalendar1_EventMenuClick" 
        OnBeforeEventRender="DayPilotCalendar1_BeforeEventRender"
        
        CssClassPrefix="calendar_silver_"
        HourNameBackColor=""
        BorderColor="#A0A0A0"
        CellBorderColor="#A0A0A0"
        EventBorderColor="#505050"
        AllDayEventBorderColor="#a0a0a0"
        
        ></DayPilot:DayPilotCalendar>
    &nbsp;&nbsp;<br />
    <daypilot:daypilotmenu id="DayPilotMenu1" runat="server" CssClassPrefix="menu_">
        <DayPilot:MenuItem Text="Open" Action="JavaScript" JavaScript="window.location.href='Edit.aspx?id=' + e.value();" ></DayPilot:MenuItem>
        
        <DayPilot:MenuItem Text="-" Action="NavigateUrl" ></DayPilot:MenuItem>
        <DayPilot:MenuItem Text="Delete (CallBack)" Action="CallBack" Command="Delete"></DayPilot:MenuItem>
        <DayPilot:MenuItem Action="PostBack" Command="Delete" Text="Delete (PostBack)" />
        <DayPilot:MenuItem Text="Delete (JavaScript using callback)" Action="JavaScript" Command='Delete' JavaScript="if (confirm('Do you really want to delete event ' + e.text() + ' ?')) ctl00_ContentPlaceHolder1_DayPilotCalendar1.eventMenuClickCallBack(e, command);"></DayPilot:MenuItem>
    </daypilot:daypilotmenu>
    <daypilot:daypilotmenu id="Daypilotmenu2" runat="server" ClientObjectName="specialmenu" CssClassPrefix="menu_">
        <DayPilot:MenuItem Action="JavaScript" JavaScript="alert('Opening event (id ' + e.value() + ')');"
            Text="Open" />
        <DayPilot:MenuItem Action="JavaScript" JavaScript="alert('Sending event (id ' + e.value() + ')');"
            Text="Send" />
        <DayPilot:MenuItem Action="NavigateUrl" Text="-" />
        <DayPilot:MenuItem Action="JavaScript" Command='Delete' JavaScript="if (confirm('Do you really want to delete event ' + e.text() + ' ?')) ctl00_ContentPlaceHolder1_DayPilotCalendar1.eventMenuClickCallBack(e, command);"
            Text="Delete (JavaScript using callback)" />
    </daypilot:daypilotmenu>
    <br />
</asp:Content>

